<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./echarts.js"></script>
    <style>
          #main{
            border: 1px solid skyblue;
            margin: 100px auto;
        }
    </style>
</head>
<body>
    <div id="main" style="width: 600px;height: 400px;"></div>
    <script>
        let myChart = echarts.init(document.querySelector('#main'))
        let option = {
            title:{
                text:'城市、消费金额瀑布图'
            },
            tooltip:{},
            legend:{
                
            },
            xAxis:{
                
                data: ['广州', '佛山', '深圳', '东莞']
            },
            yAxis:{},
            series:[
            {
                    name: '辅助',
                    type: 'bar',
                    stack: '总量',
                    itemStyle: {
                        normal: {  //设置正常情况下柱子的样式
                            barBorderColor: 'rgba(0,0,0,0)',  //设置柱子边框的颜色
                            // barBorderColor:'rgba(20,20,0,0.5)',
                            barBorderWidth: 5,  //设置柱子边框的宽度
                            color: 'rgba(0,0,0,0)'  //设置柱子的颜色
                            // color:'rgba(0,220,0,0.8)'
                        },
                        emphasis: {  //设置鼠标滑过时柱子的样式
                            barBorderColor: 'rgba(0,0,0,0)',  //设置鼠标滑动到柱子边框的颜色
                            barBorderWidth: 25,  //设置鼠标滑动到柱子边框的宽度
                            color: 'rgba(0,0,0,0)'  //设置鼠标滑动到柱子的颜色
                        }
                    },
                    data: [0, 1000, 1094, 635]
                },
                {
                    name: '购买总金额',
                    type: 'bar',  //设置柱状图
                    stack: '总量',  //设置堆积
                    itemStyle: { normal: { label: { show: true, position: 'inside' } } },
                    data: [3076, 2275, 1181, 546]
                }
            ],
        };
        myChart.setOption(option)
    </script>
</body>
</html>